package com.xbongbong.saas.service;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.menu.pojo.dto.MenuInitDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateCategoryDelDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateCategorySaveDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateCategorySortDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateDelDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateDetailDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateEnableDTO;
import com.xbongbong.pro.workorder.pojo.dto.WorkOrderTemplateSaveDTO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategoryDelVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategorySaveVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategorySortVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateDelVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateDetailVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateEnableVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateListVO;
import com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateSaveVO;
import com.xbongbong.saas.domain.entity.WorkOrderTemplateEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderTemplateEntityExt;
import com.xbongbong.sys.domain.entity.UserEntity;

import java.awt.*;
import java.util.List;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/5 14:52
 * @since v1.0
 * @version v1.0
 */
public interface WorkOrderTemplateService {
    /**
     * Description: 初始化工单模板
     * @param menuInitDTO
     * @param categoryId 模板分类id
     * @param userEntity 用户entity
     * @return java.lang.Long
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/14 15:21
     * @since v1.0
     */
    Long initTemplate(MenuInitDTO menuInitDTO, Long categoryId, UserEntity userEntity) throws XbbException;

    /**
     * Description: 获取工单模板分类及其下属模板
     * @param corpid 公司id
     * @param appId
     * @return WorkOrderTemplateListVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/5 14:57
     * @since v1.0
     */
    WorkOrderTemplateListVO getListTree(String corpid, Long appId) throws XbbException;
    /**
     * Description: 保存工单分类
     * @param workOrderTemplateCategorySaveDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategorySaveVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/7 14:44
     * @since v1.0
     */
    WorkOrderTemplateCategorySaveVO saveCategory(WorkOrderTemplateCategorySaveDTO workOrderTemplateCategorySaveDTO) throws XbbException;
    /**
     * Description: 删除工单分类（特殊逻辑：分类下有其他模板的时候，转到默认的分类下）
     * @param workOrderTemplateCategoryDelDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategoryDelVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/15 13:49
     * @since v1.0
     */
    WorkOrderTemplateCategoryDelVO delCategory(WorkOrderTemplateCategoryDelDTO workOrderTemplateCategoryDelDTO) throws  XbbException;
    /**
     * Description: 工单分类排序
     * @param workOrderTemplateCategorySortDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateCategorySortVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/7 15:46
     * @since v1.0
     */
    WorkOrderTemplateCategorySortVO sortCategory(WorkOrderTemplateCategorySortDTO workOrderTemplateCategorySortDTO) throws XbbException;
    /**
     * Description: 获取工单详情
     * @param workOrderTemplateDetailDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateDetailVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/7 14:42
     * @since v1.0
     */
    WorkOrderTemplateDetailVO getTemplateDetail(WorkOrderTemplateDetailDTO workOrderTemplateDetailDTO) throws XbbException;

    /**
     * Description: 保存工单模板
     * @param workOrderTemplateSaveDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateSaveVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/18 9:11
     * @since v1.0
     */
    WorkOrderTemplateSaveVO saveTemplate(WorkOrderTemplateSaveDTO workOrderTemplateSaveDTO) throws XbbException;
    /**
     * Description: 开关模板
     * @param workOrderTemplateEnableDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateEnableVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/18 18:44
     * @since v1.0
     */
    WorkOrderTemplateEnableVO enableTemplate(WorkOrderTemplateEnableDTO workOrderTemplateEnableDTO) throws XbbException;
    /**
     * Description: 删除模板
     * @param workOrderTemplateDelDTO
     * @return com.xbongbong.pro.workorder.pojo.vo.WorkOrderTemplateDelVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/3/18 20:18
     * @since v1.0
     */
    WorkOrderTemplateDelVO delTemplate(WorkOrderTemplateDelDTO workOrderTemplateDelDTO) throws XbbException;

    /**
     * 根据表单id获取模板
     * @param formId
     * @param corpid
     * @return
     */
    WorkOrderTemplateEntity getByFormId(Long formId, String corpid);

    Long updateTemplate(List<WorkOrderTemplateEntity> workOrderTemplateModelEntityList, MenuInitDTO menuInitDTO ,Long category ,UserEntity userEntity) throws XbbException;
}
